package zuochengyun;


import list.ListNode;

public class RemoveValueNode {

	public ListNode removeValueNode(ListNode head, int value){
		while(head != null){
			if(head.val != value){
				break;
			}
			head = head.next;
		}
		ListNode pre = head;
		ListNode cur = head;
		while(cur != null){
			if(cur.val == value){
				pre.next = cur.next;
			}else{
				pre = cur;
			}
			cur = cur.next;
		}
		return head;
	}
}
